package com.nineclock.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nineclock.system.pojo.SysFunction;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ：zhangxiaoya
 * @date ：Created in 2021/7/23 9:52
 * @description ：
 * @version: 1.0
 * @since JDK 1.8
 */
public interface SysFunctionMapper extends BaseMapper<SysFunction> {

	@Select("select sf.* from nineclock_sys.sys_function sf where sf.company_id = #{companyId} " +
			"and sf.id in (select srf.function_id from nineclock_sys.sys_role_function srf where srf.role_id = #{roleId})")
	List<SysFunction> selectFunctionListByRoleIdAndCompanyId(@Param("roleId") Long roleId, @Param("companyId")Long companyId);
}
